#pragma once

template <class T>
class SingletonClass
{
public:
	SingletonClass()
	{
		m_pInstance = (T*)this;
	}
	static T * GetInstance()
	{
		if( m_pInstance == NULL )
			m_pInstance = new T;
		return m_pInstance;
	}
	static void Release()
	{
		if( m_pInstance != NULL )
		{
			delete m_pInstance;
			m_pInstance = NULL;
		}
	}
protected:
	static T* m_pInstance;
};

template <class T>
T * SingletonClass<T>::m_pInstance = (T*)NULL;
